package com.guyj.baseproject.designpatterns.observer;

import java.util.Observable;

/**
 * Created by guyj on 2019/9/6.
 * 描述: 被观察者
 */

public class MyObservable extends Observable {
	private String name;

	public MyObservable(String name) {
		this.name = name;
	}

	public void changeWord(String word) {
		setChanged();
		notifyObservers(word);
	}

	@Override
	public String toString() {
		return "被观察者[" + name + "]";
	}
}
